// 主题配置

// 基础浅色主题
const baseLightTheme = {
  colors: {
    primary: '#007AFF',
    secondary: '#5856D6',
    success: '#34C759',
    warning: '#FF9500',
    error: '#FF3B30',
    background: '#FFFFFF',
    surface: '#F2F2F7',
    text: '#000000',
    textSecondary: '#8E8E93',
    border: '#C6C6C8',
    card: '#FFFFFF',
    shadow: 'rgba(0, 0, 0, 0.1)',
  },
  spacing: {
    xs: 4,
    sm: 8,
    md: 16,
    lg: 24,
    xl: 32,
  },
  typography: {
    h1: {
      fontSize: 24,
      fontWeight: 'bold',
      lineHeight: 32,
    },
    h2: {
      fontSize: 20,
      fontWeight: '600',
      lineHeight: 28,
    },
    h3: {
      fontSize: 18,
      fontWeight: '600',
      lineHeight: 24,
    },
    body: {
      fontSize: 16,
      fontWeight: '400',
      lineHeight: 24,
    },
    bodySmall: {
      fontSize: 14,
      fontWeight: '400',
      lineHeight: 20,
    },
    caption: {
      fontSize: 12,
      fontWeight: '400',
      lineHeight: 16,
    },
  },
  borderRadius: {
    sm: 4,
    md: 8,
    lg: 12,
    xl: 16,
    round: 9999,
  },
};

// 默认浅色主题（无季节效果）
export const lightTheme = {
  ...baseLightTheme,
};

// 春季主题（3月-5月）- 清新绿色调
export const springLightTheme = {
  ...baseLightTheme,
  colors: {
    ...baseLightTheme.colors,
    primary: '#4CAF50', // 绿色
    secondary: '#81C784', // 浅绿色
    background: '#F1F8F4', // 淡绿色背景
    surface: '#E8F5E9', // 浅绿色表面
    card: '#FFFFFF',
    border: '#A5D6A7', // 浅绿色边框
  },
};

// 夏季主题（6月-8月）- 清爽蓝色调
export const summerLightTheme = {
  ...baseLightTheme,
  colors: {
    ...baseLightTheme.colors,
    primary: '#2196F3', // 蓝色
    secondary: '#64B5F6', // 浅蓝色
    background: '#E3F2FD', // 淡蓝色背景
    surface: '#BBDEFB', // 浅蓝色表面
    card: '#FFFFFF',
    border: '#90CAF9', // 浅蓝色边框
  },
};

// 秋季主题（9月-11月）- 温暖橙色调
export const autumnLightTheme = {
  ...baseLightTheme,
  colors: {
    ...baseLightTheme.colors,
    primary: '#FF9800', // 橙色
    secondary: '#FFB74D', // 浅橙色
    background: '#FFF3E0', // 淡橙色背景
    surface: '#FFE0B2', // 浅橙色表面
    card: '#FFFFFF',
    border: '#FFCC80', // 浅橙色边框
  },
};

// 冬季主题（12月-2月）- 冷色调
export const winterLightTheme = {
  ...baseLightTheme,
  colors: {
    ...baseLightTheme.colors,
    primary: '#607D8B', // 蓝灰色
    secondary: '#90A4AE', // 浅蓝灰色
    background: '#ECEFF1', // 淡蓝灰色背景
    surface: '#CFD8DC', // 浅蓝灰色表面
    card: '#FFFFFF',
    border: '#B0BEC5', // 浅蓝灰色边框
  },
};

// 深色主题
export const darkTheme = {
  ...baseLightTheme,
  colors: {
    ...baseLightTheme.colors,
    background: '#000000',
    surface: '#1C1C1E',
    text: '#FFFFFF',
    textSecondary: '#8E8E93',
    border: '#38383A',
    card: '#1C1C1E',
    shadow: 'rgba(0, 0, 0, 0.3)',
  },
};

/**
 * 根据主题模式和季节获取主题
 * @param {string} mode - 主题模式：'light' | 'dark'
 * @param {string} season - 季节：'spring' | 'summer' | 'autumn' | 'winter' | null
 * @returns {object} 主题对象
 */
export const getTheme = (mode = 'light', season = null) => {
  if (mode === 'dark') {
    return darkTheme;
  }
  
  // 浅色模式下根据季节返回不同主题
  if (season) {
    switch (season) {
      case 'spring':
        return springLightTheme;
      case 'summer':
        return summerLightTheme;
      case 'autumn':
        return autumnLightTheme;
      case 'winter':
        return winterLightTheme;
      default:
        return lightTheme;
    }
  }
  
  return lightTheme;
};

